package com.ruoyi.system.service.impl;

import java.util.Date;
import java.util.List;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AdviceAskMapper;
import com.ruoyi.system.domain.AdviceAsk;
import com.ruoyi.system.service.IAdviceAskService;

/**
 * 意见建议Service业务层处理
 *
 * @author ruoyi
 * @date 2025-09-04
 */
@Service
public class AdviceAskServiceImpl implements IAdviceAskService
{
    @Autowired
    private AdviceAskMapper adviceAskMapper;

    /**
     * 查询意见建议
     *
     * @param adviceId 意见建议主键
     * @return 意见建议
     */
    @Override
    public AdviceAsk selectAdviceAskByAdviceId(String adviceId)
    {
        return adviceAskMapper.selectAdviceAskByAdviceId(adviceId);
    }

    /**
     * 查询意见建议列表
     *
     * @param adviceAsk 意见建议
     * @return 意见建议
     */
    @Override
    public List<AdviceAsk> selectAdviceAskList(AdviceAsk adviceAsk)
    {
        return adviceAskMapper.selectAdviceAskList(adviceAsk);
    }

    /**
     * 新增意见建议
     *
     * @param adviceAsk 意见建议
     * @return 结果
     */
    @Override
    public int insertAdviceAsk(AdviceAsk adviceAsk)
    {
        adviceAsk.setAdviceId(UUID.randomUUID().toString());
        adviceAsk.setLiuyanshijian(new Date());
        return adviceAskMapper.insertAdviceAsk(adviceAsk);
    }

    /**
     * 修改意见建议
     *
     * @param adviceAsk 意见建议
     * @return 结果
     */
    @Override
    public int updateAdviceAsk(AdviceAsk adviceAsk)
    {
        return adviceAskMapper.updateAdviceAsk(adviceAsk);
    }

    /**
     * 批量删除意见建议
     *
     * @param adviceIds 需要删除的意见建议主键
     * @return 结果
     */
    @Override
    public int deleteAdviceAskByAdviceIds(String[] adviceIds)
    {
        return adviceAskMapper.deleteAdviceAskByAdviceIds(adviceIds);
    }

    /**
     * 删除意见建议信息
     *
     * @param adviceId 意见建议主键
     * @return 结果
     */
    @Override
    public int deleteAdviceAskByAdviceId(String adviceId)
    {
        return adviceAskMapper.deleteAdviceAskByAdviceId(adviceId);
    }
}
